package com.nowcoder.community.dao;

import com.nowcoder.community.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

// @Repository和@Mapper

@Mapper
public interface UserMapper {
    // 通过id,name,email查询
    User selectById(@Param("id") int id);

    User selectByName(@Param("username") String username);

    User selectByEmail(@Param("email") String email);

    int insertUser(User user);

    // 更新状态，头像地址，密码
    int updateStatus(@Param("id") int id, @Param("status") int status);

    int updateHeader(@Param("id")int id, @Param("headerUrl")String headerUrl);

    int updatePassword(@Param("id")int id, @Param("password")String password);

}
